package com.suozq.springcloud.order.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import com.suozq.springcloud.order.payment.service.PaymentOpenFeign;
import com.suozq.springcloud.order.payment.service.impl.PaymentOpenFeignFallbackServiceImp;

@Component
public class FeignCallBackFactory implements FallbackFactory<PaymentOpenFeign>{

	@Autowired
	PaymentOpenFeignFallbackServiceImp payment;
	
	@Override
	public PaymentOpenFeign create(Throwable cause) {
		//捕获异常cause
		return payment;
	}
	
}
